<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions">

<ui:composition>
  <!--
       This composition component will render a validateLength validator 
       depending on the "minLength" and "maxLength" parameters. If one
       of them is not set, no maximum or minimum will be set. If neither
       of them are set, no validator will be rendered at all.        
  -->

  <c:choose>
    <c:when test="#{not empty minLength and empty maxLength}">
      <f:validateLength minimum='#{minLength}'/>
    </c:when>  
    <c:when test="#{empty minLength and not empty maxLength}">
      <f:validateLength maximum='#{maxLength}'/>
    </c:when>  
    <c:when test="#{not empty minLength and not empty maxLength}">
      <f:validateLength minimum='#{minLength}' maximum='#{maxLength}'/>
    </c:when>  
  </c:choose>
</ui:composition>
</html>
